From 37df8941646e7f5b9399d6ff6a21803aa281007b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 14 Oct 2005 22:15:21 +0100 Subject: [PATCH] machine_specific_memory_setup() makes the following call to setup e820: add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM); Since max_pfn is (rightly) an unsigned long, we overflow for the current definition of PFN_PHYS. Attached is my preferred solution as it will hopefully avoid similar situations that may come up in the future. Signed-off-by: srparish@us.ibm.com --- linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h index 5161768219..5fd2eadc12 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h @@ -8,7 +8,7 @@ #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) -#define PFN_PHYS(x) ((x) << PAGE_SHIFT) +#define PFN_PHYS(x) ((unsigned long long)(x) << PAGE_SHIFT) /* * Reserved space for vmalloc and iomap - defined in asm/page.h -- 2.30.2